package Algorithm.DynamicPlanning;

public class Code19_CreateMaximumNumber {
    /**
    public static int[] maxNumber2(int[] nums1, int[] nums2, int k){
        int len1 = nums1.length;
        int len2 = nums2.length;
        if (k < 0 || len1 + len2 < k){
            return null;
        }
        int[] res = new int[k];
        int[][] dp1 = getdp(nums1);
        int[][] dp2 = getdp(nums2);
        for (int get1 = Math.max(0, k - len2); get1 <= Math.min(k, len1); get1++){
            int[] pick1 = maxPick(nums1, dp1, get1);
            int[] pick2 = maxPick(nums2, dp2, k - get1);
            int[] merge = mergeBySuffixArray(pick1, pick2);
        }

    }

    public static int[] mergeBySuffixArray(int[] arr1, int[] arr2){
        int size1 = arr1.length;
        int size2 = arr2.length;
        int[] nums = new int[size1 + 1 + size2];
        for (int i = 0; i < size1; i++) {
            nums[i] = arr1[i] + 2;
        }
        nums[size1] = 1;
        for (int j = size1 + 1; j < size1 + 1 + size2; j++){
            nums[j] = arr2[j - size1 - 1] + 2;
        }
        Suffix suffix = new
    }

    public static int[] maxPick(int[] arr, int[][] dp, int pick){
        int[] res = new int[pick];
        int tmp = dp[0][pick];
        for (int i = 0; i < pick; i++) {
            res[i] = arr[tmp];
            tmp = dp[tmp + 1][pick - i - 1];
        }
        return res;
    }

    public static int[][] getdp(int[] arr){
        int size = arr.length;
        int pick = arr.length + 1;
        int[][] dp = new int[size][pick];
        dp[size - 1][1] = arr[size - 1];
        for (int i = size - 2; i >= 0; i--) {
            for (int j = 1; j < pick - i; j++){
                if (i + j == size){ // 对角线
                    dp[i][j] = i;
                } else if (arr[i] >= arr[dp[i + 1][j]]){ // 与下面的相比
                    dp[i][j] = i;
                } else { // 与下面的相比小
                    dp[i][j] = dp[i + 1][j];
                }
            }
        }
        return dp;
    }
     **/
}
